﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace Vehicle.DAL
{
    /// <summary>
    /// Copyright (C) M-Tear团队
    /// 文 件 名：Expense.cs
    /// 版    本：v1.00.0000
    /// 创建标识：2009-09-01    Created by 杨光远 V1.00.0000
    /// 功能说明：Expense表数据层类（继承于数据层基类)
    /// 注意事项：无
    /// 
    /// 更新记录：
    /// 
    /// </summary>
    class Task : DAL.Base_DAL, Vehicle.Interface.ITask
    {
        /// <summary>
        /// 绑定页面Repeater控件
        /// </summary>
        /// <param name="Rept">Repeater控件对象</param>
        /// <param name="m_ComponentsInfo">通用实体对象</param>
        public void RepeaterBind(Repeater Rept, Model.ComponentsInfo m_ComponentsInfo)
        {
            Rept.DataSource = GetAllSearch(new Model.ComponentsInfo(m_ComponentsInfo.startIndex, m_ComponentsInfo.endIndex, "Task", m_ComponentsInfo.condition, m_ComponentsInfo.result, m_ComponentsInfo.Tcondition, m_ComponentsInfo.Tresult, m_ComponentsInfo.Scondition, m_ComponentsInfo.Sresult, "T_Time", m_ComponentsInfo.StartTime, m_ComponentsInfo.EndTime, "T_ID")).DefaultView;
            Rept.DataBind();

        }
        /// <summary>
        /// 添加任务信息
        /// </summary>
        /// <param name="m_TaskInfo">实体对象</param>
        public void Add(Model.TaskInfo m_TaskInfo)
        {
            string SpName = "Task_ADD";
            object[] _object = new object[] { 0, m_TaskInfo.C_Card, m_TaskInfo.M_ID, m_TaskInfo.V_ID, m_TaskInfo.P_ID, m_TaskInfo.T_Time, m_TaskInfo.T_Note, m_TaskInfo.T_StarTime, m_TaskInfo.T_EndTime, m_TaskInfo.T_IsDelete, m_TaskInfo.T_Type, m_TaskInfo.T_LastTime, m_TaskInfo.T_Num };
            SqlHelper.ExecuteNonQuery(SpName, _object);
        }

        /// <summary>
        /// 修改任务信息
        /// </summary>
        /// <param name="m_TaskInfo">实体对象</param>
        public void Update(Model.TaskInfo m_TaskInfo)
        {
            string SpName = "Task_Update";
            object[] _object = new object[] { 0, m_TaskInfo.T_ID, m_TaskInfo.C_Card, m_TaskInfo.M_ID, m_TaskInfo.V_ID, m_TaskInfo.P_ID, m_TaskInfo.T_Time, m_TaskInfo.T_Note, m_TaskInfo.T_StarTime, m_TaskInfo.T_EndTime, m_TaskInfo.T_IsDelete, m_TaskInfo.T_Type, m_TaskInfo.T_LastTime, m_TaskInfo.T_Num };
            SqlHelper.ExecuteNonQuery(SpName, _object);
        }
    }
}
